import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Gao zhao xu
 * Date: 2023-09-23
 * Time: 15:42
 */
public class test1 {
    public static MySingleList.ListNode reverseList(MySingleList mySingleList){
        MySingleList.ListNode cur = mySingleList.head.next;
        mySingleList.head.next = null;
        while(cur != null){
            MySingleList.ListNode cur1 = cur.next;
            cur.next = mySingleList.head;
            mySingleList.head = cur;
            cur = cur1;
        }
        return mySingleList.head;
    }

    public static void main(String[] args) {
        System.out.println(5 / 2);
    }
    public static void main1(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addFirst(12);
        mySingleList.addFirst(23);
        mySingleList.addFirst(34);
        reverseList(mySingleList);
        mySingleList.show();
    }
}
